package com.hkyp.ss.course.apis.enumu;


import java.util.Objects;

/**
 * 用户类型
 */
public enum CourseStatusEnum {
    NORMAL(0,"正常"),
    DOWN(1,"下架"),  //冻结 、锁定 状态
    DELETED(2,"删除)")
    ;

    private Integer courseStatus;
    private String displayName;

    CourseStatusEnum(Integer courseStatus, String displayName) {
        this.courseStatus = courseStatus;
        this.displayName = displayName;
    }

    /**
     * 获取用户状态枚举
     * @param userStatus
     * @return
     */
    public static CourseStatusEnum getCourseStatusEnum(Integer userStatus) {
        for (CourseStatusEnum c : CourseStatusEnum.values()) {
            if (Objects.equals(userStatus,c.getCourseStatus())) {
                return c;
            }
        }
        return null;
    }

    /**
     * 获取用户状态名称
     * @param userStatus
     * @return
     */
    public static String getUserStatusName(Integer userStatus) {
        for (CourseStatusEnum c : CourseStatusEnum.values()) {
            if (Objects.equals(userStatus,c.getCourseStatus())) {
                return c.getDisplayName();
            }
        }
        return null;
    }

    public Integer getCourseStatus() {
        return courseStatus;
    }

    public void setUserStatus(Integer courseStatus) {
        this.courseStatus = courseStatus;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }
}
